<?php

namespace App\Admin\Controllers;

use Encore\Admin\Layout\Content;
use App\Http\Controllers\Controller;
use Encore\Admin\Layout\Row;
use Encore\Admin\Layout\Column;
use App\Admin\Extensions\GoldStatisticsBoxes;
use App\Models\User;
use Encore\Admin\Form;
use Encore\Admin\Controllers\HasResourceActions;
use App\Admin\Forms\GoldStatisticsForm;
use Illuminate\Http\Request;

class GoldStatisticsController extends Controller
{
    use HasResourceActions;

    public function index(Content $content,Request $request)
    {
        return $content->title('金店统计')
            ->row(function (Row $row) use($content) {
                $row->column(12, function (Column $column) {
                     $column->row(app(GoldStatisticsBoxes::class)->countBoxes());
                });
                $row->column(12, function (Column $column)  use($content){
                        $form = $this->form($content);
                });
            });
    }

    public function form(Content $content){

        $content->description("金店统计");

        return $content
            ->title("金店统计")
            ->body(new GoldStatisticsForm());

    }
   
}
